package com.jida.controller;

import com.jida.dto.ResponseObject;
import com.jida.service.UsersService;
import com.jida.service.UsersServiceImpl;
import com.jida.tijian.domain.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class UserController {
    @Autowired
    UsersService usersService;
    @Autowired
    private UsersServiceImpl usersServiceImpl;

    @RequestMapping("/login")
    /*
    public Users login(Users users){
        Users u=null;

        return u;
    }
     */
    public ResponseObject<Users> login(@RequestBody Users users){
        System.out.println("users:"+users.getPassword());
        //Users u=users;

        //ResponseObject<Users> responseObject=new ResponseObject<>( 200, "成功",u);
        ResponseObject<Users> responseObject=usersService.login(users);
        return responseObject;




    }

}
